<%--
  Created by IntelliJ IDEA.
  User: 32696
  Date: 2025/10/24
  Time: 12:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- 添加fn标签库的导入 --%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
    <title>历史记录</title>
</head>
<body>
<h1>练习历史记录</h1>
<table border="1">
    <tr>
        <th>时间</th>
        <th>题目</th>
        <th>正确答案</th>
        <th>你的答案</th>
        <th>是否正确</th>
    </tr>
    <c:forEach items="${history}" var="record" varStatus="status">
        <%-- 跳过表头行 --%>
        <c:if test="${status.index > 0}">
            <tr>
                <c:set var="fields" value="${fn:split(record, ',')}" />
                <td>${fields[0]}</td>
                <td>${fields[1]}</td>
                <td>${fields[2]}</td>
                <td>${fields[3]}</td>
                <td>${fields[4]}</td>
            </tr>
        </c:if>
    </c:forEach>
</table>
<a href="${pageContext.request.contextPath}/main">返回练习</a>
</body>
</html>
